#pragma once
#include "Physics/core.h"
#include "Physics/rigidbody.h"
#include "Physics/collide_fine.h"
#include "d3dUtil.h"
#include "RenderInfo.h"
#include "GameObject.h"
#include "ObjectTypes.h"

#define SPHERE_DEFAULTRADIUS	3

class Sphere :
	public physics::CollisionSphere, public GameObject
{
public:
	Sphere(float radius = SPHERE_DEFAULTRADIUS, ObjectMaterial material = OBJECTMATERIAL_DEFAULT, ObjectType = OBJECTTYPE_DEFAULTSPHERE);
	virtual ~Sphere(void);

	void Update(float dt);
	void Render(RenderInfo ri);

	void SpecialAbility(FuriousTourist *game);

	physics::RigidBody* GetBody(void)
	{
		return body;
	}

	int GetHP()
	{
		return mHealth;
	}

	void SetHP(int h)
	{
		mHealth = h;
	}

	bool HasHealth(void)
	{
		switch(mObjectType)
		{
		case WEAPONTYPE_NORMAL:
		case WEAPONTYPE_MULTI:
		case WEAPONTYPE_ROCKET:
		case WEAPONTYPE_EXPLODE:
		case OBJECTTYPE_CATAPULT:
			return false;
		default:
			return true;
		}
	}

	ObjectMaterial GetMaterial(void)
	{
		return mMaterial;
	}

	UINT GetType(void)
	{
		return mObjectType;
	}

	void SpecialAbility2(void)
	{
		mSetToRed = true;
	}

	void ToggleShowHealth(void)
	{
		if (HasHealth())
		{
			mShowHealth = !mShowHealth;
		}
	}

private:
	Mtrl				mMtrl;
	D3DXMATRIX			mScale;
	ObjectType			mObjectType;
	Sphere*				mMulti1;
	Sphere*				mMulti2;
	Sphere*				mMulti3;
	UINT				mMeshNum;

	int					mHealth;
	ObjectMaterial	mMaterial;
	bool				mSetToRed;
	bool				mShowHealth;
};

